<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="breadcrumbs">
        <h:form>
            <a href="index.xhtml">Website Admin</a><div class="breadcrumb_divider"></div>
            <h:commandLink action="#{studentsController.prepareList()}" value="Students"/><div class="breadcrumb_divider"></div>
            <h:commandLink value="Create" class="current"/>
        </h:form>
        </ui:define>
        <ui:define name="body">
             <h:form id="form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorClass="errorStyle" infoClass="infoStyle" layout="table"/>
            </h:panelGroup>
            <article class="module width_full">
                    <header><h3>Create student</h3></header>
                    <div class="module_content">
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateStudentsLabel_stuName}" for="stuName" />
                    <p:inputText id="stuName" value="#{studentsController.selected.stuName}" title="#{bundle.CreateStudentsTitle_stuName}" />
                    <h:outputLabel value="#{bundle.CreateStudentsLabel_stuPhone}" for="stuPhone" />
                    <p:inputText id="stuPhone" value="#{studentsController.selected.stuPhone}" title="#{bundle.CreateStudentsTitle_stuPhone}" />
                    <h:outputLabel value="#{bundle.CreateStudentsLabel_stuAddress}" for="stuAddress" />
                    <p:inputText id="stuAddress" value="#{studentsController.selected.stuAddress}" title="#{bundle.CreateStudentsTitle_stuAddress}" />
                    <h:outputLabel value="#{bundle.CreateStudentsLabel_stuEmail}" for="stuEmail" />
                    <p:inputText id="stuEmail" value="#{studentsController.selected.stuEmail}" title="#{bundle.CreateStudentsTitle_stuEmail}" />
                    <h:outputLabel value="#{bundle.CreateStudentsLabel_classId}" for="classId" />
                    <p:selectOneMenu id="classId" value="#{studentsController.selected.classId}" >
                        <f:selectItems value="#{studentsController.listClass}" var="class" itemLabel="#{class}" itemValue="#{class}"/>
                    </p:selectOneMenu>
                </h:panelGrid>
                
                <div align="right">
                    <h:commandButton action="#{studentsController.create}" value="#{bundle.CreateStudentsSaveLink}" />
                </div>
                    </div></article>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
